<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>应聘状态</title>
    <link rel="stylesheet" href="../../plugins/element-ui/theme-chalk/index.css"/>
    <script src="../../js/vue.js" charset="utf-8"></script>
    <script src="../../plugins/element-ui/index.js" charset="utf-8"></script>
    <!-- 引入axios -->
    <script src="../../plugins/axios.min.js"></script>

    <script src="../../js/request.js"></script>
    <script src="../../js/personalResumes.js"></script>

    <style name="table">
        .el-table .warning-row {
            background: oldlace;
        }

        .el-table .success-row {
            background: #f0f9eb;
        }
    </style>
</head>
<body>

<div id="container">
    <!--table表格 -->
    <template>
        <el-table
                :data="tableData"
                style="width: 100%"
                :row-class-name="tableRowClassName"
                @selection-change="handleSelectionChange">
                <el-table-column
                    prop="employerName"
                    label="单位名"
                    align="center">
                </el-table-column>
                <el-table-column
                    prop="position"
                    label="岗位"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="time"
                    label="简历投送时间"
                    align="center">
            </el-table-column>
            <el-table-column
                    prop="status"
                    label="状态"
                    align="center">
            </el-table-column>
        </el-table>
    </template>

</div>

<script>
    new Vue({
        el:"#container",
        methods: {
            //使不同行颜色不同
            tableRowClassName({row, rowIndex}) {
                if (rowIndex === 1) {
                    return 'warning-row';
                } else if (rowIndex === 3) {
                    return 'success-row';
                }
                return '';
            },

            //简历状态列表
            selectAll() {
                resumeStatusList(this.resumeStatus).then(res => {
                    if (String(res.code) === '1') {
                        this.tableData = res.data;
                    } else {
                        this.$message.error(res.msg || '查询失败')
                    }
                }).catch(err => {
                    this.$message.error('请求出错了：' + err)
                })
            },
        },
            created() {
                this.resumeStatus.name=localStorage.getItem('user');
                this.selectAll();
            },
        data() {
            return {
                tableData: [{
                    position: "前端工程师",
                    employerName: "武科大保卫处",
                    time:"2023-2-28",
                    status:'审核中',
                },
                ],
                //应聘状态模型数据
                resumeStatus:{
                    name:"",
                    employerName:'',
                    //应聘岗位
                    position:"",
                    //投送简历时间
                    time:"",
                    status:'',
                },

            }
        }
    })
</script>
</body>
</html>